<?php


namespace app\shopConsole\service\user;


use app\dao\user\ShopUserDao;
use app\model\ShopUser;


class UserQueryService
{
    public function getList(array $data)
    {
        $shopUserDao = new ShopUserDao();
        if ($data['all'])
        {
            return $shopUserDao->getAll($data);
        }else{
            return $shopUserDao->getPageList($data);
        }

    }

    public function getByUser(ShopUser $shopUser)
    {
        $shopUserDao = new ShopUserDao();
        return $shopUserDao->getById($shopUser->id);
    }
}